#ifndef DATASTRUCT_H
#define DATASTRUCT_H

#include <QString>
#include <QList>
#include <QTime>

class Station
{
public:
    int ID;
    QString name;
};

class Train
{
public:
    Train(){};

    QString ID;

    void appendStation(Station &station, QTime &time);
    void insertStation(Station station, QTime time, int index);
    void deleteStation(int index);
    void getItem(Station &out_station, QTime &out_time, int index);
    int length() const;

    Train(const Train&);
private:
    QList<Station> stationList;
    QList<QTime> timeList;
};

class Ticket
{
public:

    QString ID;
    QString trainNum;
    int startStationIndex;
    int arrivalStationIndex;

    int seatNum;
//    QString date;
    double price;
//    QString idNum;
};

class TicketRecord
{
public:
    int ID;
    int ticketType;   //票种类
    QString date;
    int ticketNum;    //票数
    int restNum;
    QString trainNum;
    int startStation;
    int arrivalStation;
    double price;
};

class TrainTicket
{
public:
    int ID;
    int ticketType;
    QString date;
    QString trainNum;
    int startStation;
    QString startTime;
    int arrivalStation;
    QString arrivalTime;
    double price;
    QString seatNum;
    QString userID;
};

class User
{
public :
    QString ID;
    QString name;
    QString password;
    QString idNum;
};


#endif // DATASTRUCT_H
